<?php
/**
 * Simple grab example
 *
 * @category   HTML
 * @package    AJAX
 * @author     Arpad Ray <arpad@php.net>
 * @copyright  2005 Arpad Ray
 * @license    http://www.opensource.org/licenses/lgpl-license.php  LGPL
 * @version    Release: 0.5.6
 * @link       http://pear.php.net/package/HTML_AJAX
 */

include 'HTML/AJAX.php';

if (isset($_GET['grab'])) {
    die('Grabbed from php!');
}

$ajax = new HTML_AJAX();
if ($ajax->handleRequest()) {
    exit;
}

?><html>
<head>
<script type='text/javascript' src="../js/HTML_AJAX.js"></script>
<script type="text/javascript">
var BugFixes = {
    /**
     * @link http://pear.php.net/bugs/11542
     */
    bug11542: function()
    {
        var i = 0;
        result = HTML_AJAX.grab('grab.php?grab=1');
        alert(i);
    }
}
</script>
</head>
<body>
<a href="#" onclick="BugFixes.bug11542();">Test bugfix 11542 (Should alert 0)</a>
</body>
</html>
